//
//  KLMEmptyView.swift
//  KLM_GN
//
//  Created by Nic on 2025/2/25.
//

import UIKit

class KLMEmptyView: UIView {

    @IBOutlet weak var tipLabel: UILabel!
    @IBOutlet weak var imageView: UIImageView!
    
    override func awakeFromNib() {
        super.awakeFromNib()

        self.backgroundColor = .clear
        imageView.image = UIImage(named: "empty")
        
        tipLabel.configStyle(with: KLMLocalizable.LANGLOC("No devices"), font: UIFont.systemFont(ofSize: 16), titleColor: rgba(196, 196, 196, 1))
    }

    func updateContent(image: String? = nil, tip: String? = nil) -> Void {
        if let image = image {
            imageView.image = UIImage(named: image)
        }
        if let tip = tip {
            tipLabel.text = tip
        }
        setNeedsLayout()
        layoutIfNeeded()
    }
}
